# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=plasma-pa
pkgver=6.2.3
pkgrel=0
pkgdesc="Plasma applet for audio volume management using PulseAudio"
# armhf blocked by qt6-qtdeclarative
# s390x blocked by plasma-workspace
arch="all !armhf !s390x"
url="https://kde.org/plasma-desktop/"
license="LGPL-2.1-only OR LGPL-3.0-only AND GPL-2.0-only"
depends="
	kirigami
	kquickcharts
	pulseaudio
	"
makedepends="
	extra-cmake-modules
	kcmutils-dev
	kcoreaddons-dev
	kdeclarative-dev
	kdoctools-dev
	kglobalaccel-dev
	ki18n-dev
	knotifications-dev
	kstatusnotifieritem-dev
	ksvg-dev
	libcanberra-dev
	libplasma-dev
	plasma-workspace-dev
	pulseaudio-qt-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	samurai
	"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma-pa.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-pa-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DUSE_GCONF=OFF
	cmake --build build
}

check() {
	# applettest requires Selenium
	ctest --test-dir build --output-on-failure -E "applettest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9a4202d6aca8b62553e074a0ee5dbea0aee834339f16d78cce6cd1ad8151e015189fe98201c3adcf5534993826f8209a05385a1a7d191b08610ede3094a758d7  plasma-pa-6.2.3.tar.xz
"
